package com.sunyifeng.ch03;

public class Singleton4DCL {
    private volatile static Singleton4DCL singleton;

    private Singleton4DCL() {
    }

    public static Singleton4DCL getSingleton() {
        if (singleton == null) {
            synchronized (Singleton4DCL.class) {
                if (singleton == null) {
                    singleton = new Singleton4DCL();
                }
            }
        }
        return singleton;
    }
}